﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="XZJobTrainDetail.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.XZModel.XZJobTrainDetail" %>
<style>
    
    .XZJobTrainDetailtable{border:solid #000; border-width:1px;border-collapse: collapse; }
    .XZJobTrainDetailtable th{border:solid #000; border-width:1px; line-height:20px; padding:2PX; font-weight:bold;}
    .XZJobTrainDetailtable td 
    {
        border-bottom: 1px solid #000;
        border-right: 1px solid #000;
        line-height: 21px;
        overflow: hidden;
        padding: 0 3px;   
    }
</style>
<div class="pageContent" style="border:1px #B8D0D6 solid;" >
    <form method="post" action="XZModel/XZJobTrainDetail.aspx?ajaxmethod=update&JobId=<%=JobId %>" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone)">
    <div class="pageFormContent" layoutH="66">
        <h2 style=" text-align:center; line-height:25px;"><%=XZJobListObj.JobDept%>(<%=XZJobListObj.Title%>)入职培训内容</h2>
        <table  style="width:97%">
            <tr>
                <td width="20%" style=" line-height:25px;">入职员工：</td>
                <td  width="50%" style=" line-height:25px;">
                    <input type="text" id="XZJobTrainDetail_UserName"  />
                </td>
                
                <td width="15%" style=" line-height:25px;">入职时间：</td>
                <td width="15%" style=" line-height:25px;">
                    <input type="text" class="date"  id="XZJobTrainDetail_FromDate"  />
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <table class="XZJobTrainDetailtable"  style="width:100%; ">
                        <tr>
                            <th width="10%">选择</th>                           
                            <th width="60%">具体内容</th>
                            <th width="10%">课时</th>
                            <th width="10%">计时单位</th>
                        </tr>
                        <asp:repeater id="rpMenu" runat="server">
                        <ItemTemplate>
                              <tr>
                                <td  colspan="4" style="font-weight:bold; background-color:#ccc;">
                                    <input type='checkbox' name='deptselectcheck' TrainDept="<%# Eval("TrainDept")%>" /><%# Eval("TrainDept")%>
                                </td>                                
                              </tr>
                             <%# GetSubTrainHtml(Eval("TrainDept"))%>
                        </ItemTemplate>                       
                        </asp:repeater>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    <div class="formBar">
			<ul>	
                <li style=" line-height:30px;  color:Red;"><a href="#" id="XZJobTrainDetail_Export" target="_blank">导出</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>			
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<%--<div class="button"><div class="buttonContent"><button type="button" class="">导出</button></div></div>--%>
				</li>
			</ul>
		</div>    
    </form>
</div>
<script>
    $(document).ready(function () {
        $(":checkbox[name='checkselected']").change(function () {
            checkpagecheckboxXZJobTrainDetail();
        })

        checkpagecheckboxXZJobTrainDetail();
        $(":checkbox[name='deptselectcheck']").change(function () {
            var $TrainDept = $(this).attr("TrainDept");
            $(":checkbox[SubTrainDept='" + $TrainDept + "']").attr("checked", $(this).attr("checked"))
            checkpagecheckboxXZJobTrainDetail();
        })

        $("#XZJobTrainDetail_Export").click(function () {
            var $XZJobTrainDetail_UserName = $("#XZJobTrainDetail_UserName").val();
            var $XZJobTrainDetail_FromDate = $("#XZJobTrainDetail_FromDate").val();
            var ulr = "<%=ExportExcelWebUrl %>/XZModel/ExportXZJobTrain.aspx?JobId=<%=JobId %>&UserName=" + escape($XZJobTrainDetail_UserName) + "&FromDate=" + $XZJobTrainDetail_FromDate
            window.open(ulr, '_blank');
            return false;
        })
    })

    function checkpagecheckboxXZJobTrainDetail() {

        $(":checkbox[name='checkselected']").each(function () {
            if ($(this).is(':checked')) {
                $(this).closest("tr").find(":text").removeAttr("disabled");
                $(this).closest("tr").find("select ").removeAttr("disabled");
                $(this).closest("tr").find("td").css("color", "red");
            }
            else {
                $(this).closest("tr").find(":text").attr("disabled", "disabled");
                $(this).closest("tr").find("select ").attr("disabled", "disabled");
                $(this).closest("tr").find("td").css("color", "#000");
            }
        })
    }
</script>
